import 'package:flutter/material.dart';
import 'package:get/get.dart';

class TitleBar extends StatelessWidget {
  // @override
  // final Size preferredSize;

  // TitleBar(): preferredSize = Size.fromHeight(48);

  final String? title;
  final String? rightText;

  TitleBar({this.title, this.rightText});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: Get.size.width,
      child: Flex(
        direction: Axis.horizontal,
        children: [
          Expanded(
            child: Center(
              child: Text(
                title ?? "",
                style: TextStyle(fontSize: 16, color: Colors.white),
              ),
            ),
          ),
          InkWell(
            child: Text(
              rightText ?? "",
              style: TextStyle(fontSize: 14, color: Colors.white),
            ),
          )
        ],
      ),
    );
  }
}
